package edu.bupt.hbase;

import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class ForTest {
    // 应该是从只有1条关系的人处开始清理。只有1条关系的
    //
    //
    public static void main(String[] args) {
        int n = 0;
        int m = 0;

        int relations = 0;

        Scanner sc = new Scanner(System.in);
        String param = sc.next();
        String[] split = param.split("");
        n = Integer.parseInt(split[0]);
        m = Integer.parseInt(split[1]);


        int[][] male = new int[n+1][n+1];
        int[][] female = new int[n+1][n+1];

        int[][] studentss = new int[n+1][n+1];


        while (sc.hasNext()){
            String str = sc.next();
            String[] s = str.split(" ");
            int i = Integer.parseInt(s[0]);
            int j = Integer.parseInt(s[1]);
            // 确保i数字更小。
            if (i>j){
                int tempt = i;
                i = j;
                j = tempt;
            }
           // students[i] = students[i] +1;
            //students[j] = students[j] +1;
            studentss[i][j-n] =  1;
            studentss[j-n][i] = 1;

            int maleNu = male[i][0];
            male[i][maleNu]=j;
            male[i][0] = maleNu + 1;

            int femaleNu = female[j-n][0];
            female[j-n][femaleNu] = i;
            female[j-n][0] = femaleNu + 1;


            for (int p=1;p<=n;p++){

                if (male[p][0]==1){
                    int jNo = male[p][1];
                }
            }

            relations++;
        }

        //Arrays.sort(students);



    }
    private static void dfs(int[] male, int i, int j, List<Integer> toremove){
        for (int p=1;p<=male.length;p++){
            if(male[p]==1){

            }
        }
    }

}
